<!DOCTYPE html>
<html lang="zh_CN">
<head>
<#--引入外部文件-->
    <#include "../common/header.ftl">
</head>
<body>

<div class="container" style="margin-top: 20px">
    <#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-3">
            <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">用户通知管理</h1>
                </div>
            </div>
        <#--高级查询--->
            <form class="form-inline" id="searchForm" action="/systemNotice/release.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
            </form>

            <table class="table table-striped table-hover" >
                <tr>
                    <th>编号</th>
                    <th>被通知用户</th>
                    <th>通知内容</th>
                    <th>通知时间</th>
                    <th>读取情况</th>
                    <th></th>
                </tr>
            <#--使用Freemark的指令完成循环迭代-->
                <#list pageInfo.list as entity>
                    <tr>
                        <td>${entity_index + 1}</td>
                        <td>${entity.user.nickName}</td>
                        <td>${entity.content!}</td>
                        <td>${(entity.createTime?string("yyyy-MM-dd"))!}</td>
                        <td>
                            <#if entity.isnew??>
                                <#if entity.isnew==1 >
                                    未读
                                <#elseif entity.isnew==2>
                                     已读
                                </#if>
                            </#if>
                        </td>
                        <td>
                            <a href="javascript:" class="btn btn-danger btn-xs deleteBtn" data-json='${entity.json}'>
                                <span class="glyphicon glyphicon-pencil"></span> 删除通知
                            </a>
                        </td>
                    </tr>
                </#list>
            </table>

            <#include "../common/page.ftl">
        </div>
    </div>
</div>



<script>
    $(function () {
        $(".deleteBtn").click(function () {
            var obj = $(this).data("json")
            console.log(obj);
            $.get("/systemNotice/delete.do",{id:obj.id},function (data) {
                if (data.success) {
                    window.location.reload();
                }
            });
        });
    })
</script>
</body>
</html>